#ifndef HLA_PROCESSOR_H
#define HLA_PROCESSOR_H

#include <odfgen/odfgen.h>
#include "hladata_parser.h"

typedef float ProcessorPriority;

struct HlaProcessor
{
    virtual ~HlaProcessor(){}

    virtual ProcessorPriority get_priority() const = 0;
    virtual void process(const HlaData& hlaData) = 0;
    virtual void generate_results(Spreadsheet& spreadsheet) = 0;
};


template <class Processor>
struct ProcessorRegisterer
{
    ProcessorRegisterer()
    {
        extern void register_processor(HlaProcessor*);
        register_processor(new Processor);
    }
};

#define REGISTER_PROCESSOR(Processor) \
    static ProcessorRegisterer<Processor> _registerer_##Processor


// partial implementations ---------------------------

class HlaGroupsPairProcessor : public HlaProcessor
{
    virtual void process(const Group& g1, const Group& g2) = 0;
    virtual void process(const HlaData& hlaData);
};

class HlaGroupsProcessor : public HlaProcessor
{
    virtual void process(const Group& g) = 0;
    virtual void process(const HlaData& hlaData);
};

#endif

